import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref } from 'vue';
import {VxeFormItemProps, VxeGridPropTypes} from "@/components/VxeTable";
import util from "@/utils/util";


/**
 */
export const vxeTableColumns: VxeGridPropTypes.Columns = [
  {
    title: '姓名',
    field: 'userName',
    showOverflow: 'title',
    width: 120,
    align: 'center',
  },
  {
    title: '月份',
    field: 'month',
    showOverflow: 'title',
    width: 110,
    align: 'center',
  },
  {
    title: '小时',
    field: 'hours',
    align: 'center',
    width: 120,
  },
  {
    title: '天',
    field: 'days',
    align: 'center',
    width: 130,
  },

  // {
  //   width: 100,
  //   title: '操作',
  //   align: 'center',
  //   field: '',
  //   slots: { default: 'action' },
  //   fixed: 'right',
  // },
];




export const vxeTableFormSchema: VxeFormItemProps[] = [
  {
    span: 6,
    field: 'userName',
    title: '搜索',
    itemRender: {
      props: {
        placeholder: '名称',
      },
      name: 'AInput',
    },
  },
  {
    span: 6,
    field: 'month',
    title: '月份',
    itemRender: {
      defaultValue:util.getCurrentMonth(),
      props: {
        valueFormat: 'YYYY-MM', //-DD
      },
      name: 'AMonthPicker',
    },
  },
  {
    field: 'groupIdIn',
    title: '小组',
    span: 6,
    slots:{default:"groupId_slot"}
  },
  {
    span: 5,
    itemRender: {
      name: 'VxeButtonGroup',
      options: [
        { type: 'reset', content: '重置' },
        { type: 'submit', content: '查询', status: 'primary' },
      ],
    },
  },
];


export const formSchema: FormSchema[] = [

  {
    field: 'cheJianName',
    label: '车间名称',
    component:"Select",
    componentProps:{
      options:[
        {label:"DKL车间",value:"DKL车间"},
        {label:"钟车间",value:"钟车间"},
        {label:"OEM车间",value:"OEM车间"},
        {label:"钢壳厂",value:"钢壳厂"},
        {label:"表壳厂",value:"表壳厂"},
      ]
    },
    required: true,
  },
  {
    field: 'groupName',
    label: '小组名称',
    required: true,
    component: 'Input',
  },
  {
    field: 'deptId',
    label: 'deptId',
  },
  {
    field: 'groupUserId',
    label: 'groupUserId',
  },
  {
    field: 'groupUserId2',
    label: 'groupUserId2',
  },
  {
    field: 'manageUserId',
    label: 'manageUserId',
  },
  {
    field: 'deptName',
    label: '部门',
    slot: "deptName",
    required: true
  },

  {
    label: '组长',
    field: 'groupUserName',
    slot: 'groupUserNameSlot',
  },
  {
    label: '大组长',
    field: 'groupUserName2',
    slot: 'groupUserNameSlot',
  },
  {
    label: '领导',
    field: 'manageUserName',
    slot: 'manageUserNameSlot',
  },
  {
    field: 'manageSkip',
    label: '领导跳过审批',
    component:"Select",
    componentProps:{
      options:[
        {label:"否",value:0},
        {label:"是",value:1},
      ]
    },
  },
  {
    field: 'remark',
    label: '备注',
    component: 'Input',
  },
];
